home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
realftp
/
testftp.frm
< prev
next >
Wrap
Text File
|
1997-05-06
|
5KB
|
169 lines
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
Object = "{0E4C9099-C4EB-11D0-B4B6-444553540000}#8.1#0"; "RealFtp.ocx"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5820
ClientLeft = 60
ClientTop = 345
ClientWidth = 7125
LinkTopic = "Form1"
ScaleHeight = 5820
ScaleWidth = 7125
StartUpPosition = 3 'Windows Default
Begin RealFtp.Ftp Ftp1
Left = 120
Top = 5160
_ExtentX = 873
_ExtentY = 873
End
Begin VB.CommandButton Command2
Caption = "Stop"
Height = 495
Left = 6120
TabIndex = 6
Top = 480
Width = 855
End
Begin VB.TextBox Text4
Height = 285
Left = 4560
TabIndex = 5
Text = "Text4"
Top = 480
Width = 495
End
Begin ComctlLib.ProgressBar ProgressBar1
Height = 255
Left = 840
TabIndex = 4
Top = 840
Width = 4215
_ExtentX = 7435
_ExtentY = 450
_Version = 327680
Appearance = 1
MouseIcon = "TestFtp.frx":0000
End
Begin VB.Timer Timer1
Interval = 1000
Left = 720
Top = 5160
End
Begin VB.TextBox Text3
Height = 285
Left = 2760
TabIndex = 3
Text = "Text3"
Top = 480
Width = 1215
End
Begin VB.TextBox Text2
Height = 285
Left = 840
TabIndex = 2
Text = "Text2"
Top = 480
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Start"
Height = 495
Left = 5160
TabIndex = 1
Top = 480
Width = 855
End
Begin RichTextLib.RichTextBox status
Height = 3855
Left = 120
TabIndex = 0
Top = 1200
Width = 6975
_ExtentX = 12303
_ExtentY = 6800
_Version = 327680
ScrollBars = 2
DisableNoScroll = -1 'True
TextRTF = $"TestFtp.frx":001C
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "This application is a sample only. You must edit the code before attempting use."
Height = 255
Left = 120
TabIndex = 11
Top = 120
Width = 6855
End
Begin VB.Label Label4
Caption = "Rate"
Height = 255
Left = 4080
TabIndex = 10
Top = 480
Width = 495
End
Begin VB.Label Label3
Caption = "Current"
Height = 255
Left = 2160
TabIndex = 9
Top = 480
Width = 615
End
Begin VB.Label Label2
Caption = "Total"
Height = 255
Left = 120
TabIndex = 8
Top = 480
Width = 495
End
Begin VB.Label Label1
Caption = "Progress"
Height = 255
Left = 120
TabIndex = 7
Top = 840
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'This application is a test application, please do not
'use it verbatim. You must edit the logon sequence and
'all transfer filenames.
'
Private Sub Command1_Click()
Ftp1.Logon "ftp.myserver.com", "myusername", "mypassword"
Ftp1.GetDir "c:\temp\dirlist.txt", "o"
Ftp1.SendFile "c:\temp\zbspro.exe", "zbspro.exe", 1
Ftp1.GetFile "c:\temp\zbspro2.exe", "zbspro.exe", 1
Ftp1.CloseFtp
End Sub
Private Sub Command2_Click()
Ftp1.FtpStop
End Sub
Private Sub ftp1_SocketError(ByVal s As String)
status.Text = status.Text + s + Chr(13) + Chr(10)
End Sub
Private Sub ftp1_SocketCompleted()
status.Text = status.Text + "Complete" + Chr(13) + Chr(10)
End Sub
Private Sub ftp1_SocketResponse(ByVal s As String)
status.Text = status.Text + "res:" + s + vbCrLf
End Sub
Private Sub Timer1_Timer()
Text2.Text = Str(Ftp1.CurrentBytes)
Text3.Text = Str(Ftp1.TotalBytes)
Text4.Text = Str(Ftp1.TransferRate)
ProgressBar1.Value = Ftp1.CompletedPercent
End Sub